<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>广告管理</title>
<link rel="stylesheet" type="text/css" href="http://localhost/0423/suning/Application/Admin/View/Public/css/admin_style.css" />
<link rel="stylesheet" type="text/css" href="http://localhost/0423/suning/Application/Admin/View/Public/css/table.css" />
<script src="http://localhost/0423/suning/Static/js/jquery-1.7.2.min.js"></script>
<script src="http://localhost/0423/suning/Application/Admin/View/Public/js/IndexAd.js"></script>
<!-- <script src="http://localhost/0423/suning/Application/Admin/View/Public/js/jquery-1.4.4.min.js"></script> -->
 <script src="http://localhost/0423/suning/Static/js/alert.js"></script>  
<script src="http://localhost/0423/suning/Application/Admin/View/Public/js/iframe.js"></script>

</head>
<body class="right_body">
	<div class="body">
		<div class="top_subnav">CMS内容管理平台 ＞ 广告管理</div>


		<div style="clear:both"></div>
		<div class="use_meth">
			<div class="title">
				<div class="title_info light">
					网站广告管理 <div class="right_adTitle btnajax" style="margin-top: 1px;" ><a href="http://localhost/0423/suning/index.php/Admin/Ad/addAd/" class="" >添加广告</a></div>
				</div>
			</div>
	<!-- /////////////////////// -->
	 <table class="hd-table hd-table-list">
        <thead>
        <tr>
            <td>编号</td>
            <td>广告名称</td>
            <td>广告类型</td>
            <td>文件名</td>
            <td>调用代码</td>
             <td>复制调用代码</td>
            <td width="200">操作</td>
        </tr>
        </thead>

       
       	<?php foreach ($adInfo as $k=>$v){?>
            <tr>
            <td><?php echo $k;?></td>
            <td width="200"><?php echo $v['adName'];?></td>
            <td><?php echo $v['adType'];?></td>
            <td><?php echo $v['adFilename'];?></td> 
            <td><input type="text" class="adCode" value="<script type='text/javascript' src='http://localhost/0423/suning/ad/js/<?php echo $v['adFilename'];?>.js' ></script> "/></td>
             <td><a href="javascript:;" class="hd-btn hd-btn-success hd-btn-xm copyCode">复制调用代码</a></td>
            <td width="300">
            	
            	
            	<a href="http://localhost/0423/suning/index.php/Admin/Ad/editAd/fileName/<?php echo $v['adFilename'];?>" class="hd-btn hd-btn-primary hd-btn-xm">编辑</a>
            	<a href="javascript:hd_modal_del('<?php echo $v['adFilename'];?>');" class="hd-btn hd-btn-danger hd-btn-xm">删除</a>
            </td>
            </tr>
        <?php }?>
               
    </table>
			<!-- /////////////////////// -->
		</div>
	
	</div>

<script type="text/javascript">
    function hd_modal_del(adFilename) {
        hd_modal({
            width: 400,//宽度
            height: 150,//高度
            title: '确认删除吗？',//标题
            content: '',//提示信息
            button: true,//显示按钮
            button_success: "确定",//确定按钮文字
            button_cancel: "取消",//关闭按钮文字
            timeout: 0,//自动关闭时间 0：不自动关闭
            shade: false,//背景遮罩
            shadeOpacity: 0.4,//背景透明度
            success: function () {//点击确定后的事件
                location.href = "http://localhost/0423/suning/index.php/Admin/Ad/del/fileName/"+adFilename;
            },
            cancel: function () {//点击关闭后的事件
                
            }
        });
    }
</script>


</body>
</html>
